package ua.kharkov.knure.mikhaylov.st4.db.entities;

import java.io.Serializable;

import ua.kharkov.knure.mikhaylov.st4.db.enums.AccountState;

/**
 * Account db entity
 * 
 * @author Saint
 *
 */
public class Account implements Serializable{

	private static final long serialVersionUID = -2402139946146046919L;
	
	private long id;
	private double balance;
	private Valuta valuta;
	private User user;
	private AccountState accountState;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public double getBalance() {
		return balance;
	}

	public void setBalance(double balance) {
		this.balance = balance;
	}

	public Valuta getValuta() {
		return valuta;
	}

	public void setValuta(Valuta valuta) {
		this.valuta = valuta;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public AccountState getAccountState() {
		return accountState;
	}

	public void setAccountState(AccountState accountState) {
		this.accountState = accountState;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof Account))
			return false;
		Account other = (Account) obj;
		return (id == other.id && balance == other.balance
				&& valuta.equals(other.valuta)
				&& user.equals(other.user)
				&& accountState.equals(other.accountState));
	}
}
